<template>
  <div class="home">
      <!--首页头部-->
      <el-header style="text-align: right; font-size: 12px">
        <el-dropdown>
          <i class="el-icon-setting" style="margin-right: 15px"></i>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>个人信息</el-dropdown-item>
            <el-dropdown-item>退出系统</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
        <span class="username">
         <!-- 从store里面获取用户名-->
          <!-- {{$store.state.userinfo.username}}-->
          {{username}}
        </span>
      </el-header>
      <!-- 首页主体 -->
      <el-main>
        后端首页
      </el-main>
  </div>
</template>

<script>
  export default {
    name: 'home',
    computed: {
        username () {
          return this.$store.state.userinfo.username
        }
    }
  }
</script>

<style scoped>
  .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  .home{
    width: 100%;
  }

  .username{
    font-size: 20px;
    color: #409eff;
  }
</style>
